package com.csd.service.impl;

import com.csd.dto.PageBean;
import com.csd.mapper.SysOrderMapper;
import com.csd.po.PageOrder;
import com.csd.service.SysOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 订单接口实现层
 * @program: CeSuDi_SSM
 * @author: qinjianbao
 * @create: 2020-12-24 13:26
 * @Version: 1.0
 */
@Service
public class SysOrderServicImpl implements SysOrderService {
    @Autowired(required = false)
    private SysOrderMapper sysOrderMapper;

    /**
     * 添加订单
     * @param id 用户id
     * @param cid 车id
     * @param getid 取车id
     * @param backid 还车id
     * @param oprice 订单金额
     */
    @Override
    public void addOrder(int id, int cid, int getid, int backid, double oprice) {

     sysOrderMapper.addOrder(id,cid ,getid,backid, oprice,"已预订");
    }

    /**
     * 查询全部
     * @param id
     * @param page
     * @return
     */
    @Override
    public List<PageOrder> selectAll(Integer id, Integer page) {
        return sysOrderMapper.selectAll(id);
    }

    /**
     * 删除订单
     * @param id
     */
    @Override
    public void delOrderById(Integer id) {
        sysOrderMapper.delOrderById(id);
    }


}
